#ifndef ROBOTMAP_H
#define ROBOTMAP_H

#include "mapviewer/MapViewer.h"
#include <utility>

class Robot ;

typedef std::pair <int, int> Coord ;



class RobotMap {
private :
    MapViewer* _map ;
    Robot* _robot ;
    Coord _coord ;
	
	std::map<const Tile*, int> _ressourcesMatch ;
	std::vector<std::string> _ressourcesTypes ;
public:
    RobotMap(MapViewer* map = 0, Robot* robot = 0, int x = 1, int y = 1);
	MapViewer* mapViewer() const ;
    Robot* robot() const ;
    const Coord& position() const ;
	
	void setRobot(Robot* robot) ;
	void setMapViewer(MapViewer* mapviewer) ;
	void addRessourceType(const std::string& rt) ;
	void setRessourceMatch(const QPixmap& tile, int rType) ;

    void moveUp() ;
    void moveDown() ;
    void moveLeft() ;
    void moveRight() ;
	
	int ressource(int x, int y) const ;
	const std::string& ressourceString(int x, int y) const ;
	std::list<int> ressources() const ;

    void updateRobotImagePosition() ;
	void setRobotPosition(int x, int y) ;
	
	void launchScript(const std::string& file) ;
};

#endif // ROBOTMAP_H
